//用来创建约束对象和模型对象

//引入mongoose模块
const mongoose = require('mongoose');

//创建约束对象
const Schema = mongoose.Schema;
const students_info_schema = new Schema({
    stu_id:{
        type:String,
        unique:true,
        required:true
    },
    stu_name:{
        type:String,
        unique:false,
        required:true
    },
    stu_sex:{
        type:String,
        unique:false,
        required:true,
    },
    stu_date:{
        type:Date,
        default:Date.now
    },
    stu_jg:{
        type:String,
    },
    stu_gbf:{
        type:String,
        default:'蔡徐坤'
    },
    stu_hobby:Schema.Types.Mixed,//数据可以是任意类型
    stu_head_img:{
        type:String
    }
});
//创建模型对象
module.exports = mongoose.model('students_info',students_info_schema);